<?php

namespace App\Http\Controllers\PC;

use App;
use App\Common\Status;
use App\Http\Logic\PC\BusinessLogic;
use App\Http\Controllers\Controller as BaseController;
use Illuminate\Http\Request;

class BusinessController extends BaseController
{
    /**
     * @return \Illuminate\Http\JsonResponse
     */
    public function BusinessList(Request $request)
    {
        $params = $request->query();

        $pageSize = $request->query("pageSize", Status::PAGE_SIZE);
        $page     = $request->query("page", Status::PAGE);
        $r = BusinessLogic::getBusiness($params, $pageSize, $page);

        return $this->success(Status::SUCCESS, 'success', $r);
    }

    /**
     * @return \Illuminate\Http\JsonResponse
     */
    public function getBusinessDt($id)
    {
        $r = BusinessLogic::getBusinessDt($id);

        return $this->success(Status::SUCCESS, 'success', $r);
    }

    /**
     * @return \Illuminate\Http\JsonResponse
     */
    public function getRecruitList($id, Request $request)
    {
        $hot = $request->query("hot");
        $r   = BusinessLogic::getRecruitList($id, $hot);
        return $this->success(Status::SUCCESS, 'success', $r);
    }

    /**
     * @return \Illuminate\Http\JsonResponse
     */
    public function getCategorys(Request $request)
    {
        $params = $request->query();

        $r = App\Http\Logic\Admin\PositionCategoryLogic::getCategoryList($params);

        return $this->success(Status::SUCCESS, 'success', $r);
    }
}
